package com.pzhuweb.sgblog.domain.enums;

public enum AppHttpCodeEnum {
    // 成功
    SUCCESS(200, "操作成功"),
    // 登陆
    NEED_LOGIN(401, "需要登录后操作"),
    NO_OPERATOR_AUTH(403, "无权限操作"),
    SYSTEM_ERROR(500, "出现错误"),
    USERNAME_EXIST(501, "用户名已存在"),
    PHONE_NUMBER_EXIST(502, "手机号已存在"), EMAIL_EXIST(503, "邮箱已存在"),
    REQUIRE_USERNAME(504, "必需填写用户名"),
    COMMENT_ISNULL(402, "评论不能为空"),
    LOGIN_ERROR(505, "用户名或密码错误"),
    FILE_TYPE_ERROR(506, "文件类型错误，请上传png文件"),
    USERNAME_ISNULL(509, "用户名不能为空"),
    EMAIL_ISNULL(507, "邮箱不能为空"),
    NICKNAME_ISNULL(508, "昵称不能为空"),
    PASSWORD_ISNULL(510, "密码不能为空"), LIST_IS_NULL(402, "内容不能为空"),
    TITLE_IS_NULL(402, "标题和摘要不能为空"),
    PHONE_NUMBER_ISNULL(511, "手机号码不能为空"),
    ROLE_NAME_ISNULL(512, "角色名称不能为空"),
    ROLE_KEY_ISNULL(513, "权限字符不能为空"),
    MENU_NAME_ISNULL(514, "菜单名称不能为空"),
    ORDER_NUM_ISNULL(515, "排序字段不能为空"),
    PATH_IS_NULL(516, "路由地址不能为空"),
    FIELD_EXIST_NULL(517, "不能传递空字段"),
    SUBMENU_EXIST(500, "存在子菜单，无法删除！"),
    CATEGORY_NAME_ISNULL(500, "分类名不能为空!"),
    CATEGORY_DESCRIPTION_ISNULL(500, "分类描述不能为空!"),
    LINK_NAME_ISNULL(500, "友链名称不能为空!"),
    LINK_DESCRIPTION_ISNULL(500, "友链描述不能为空"),
    LINK_LOGO_ISNULL(500, "友链logo链接不能为空"),
    LINK_ADDRESS_ISNULL(500, "友链地址不能为空");


    private int code;
    private String msg;

    AppHttpCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
